﻿using Microsoft.CodeAnalysis.Text;
using System;
using System.Collections.Generic;
using System.Text;

namespace Miao.SourceGen.Learn
{
    public static class MyGenerate
    {
        public static SourceText GenerateSourceText()
        {
            const string text = 
                @"using Miao.UI;
                 using UnityEngine;

namespace Test
{
    public partial class FastTest : IUIExtend
    {
       public void OutPut()
        {
            Debug.Log(""输出成功"");
        }
    }

}
";


            var sourceBuilder = new StringBuilder();
            //这个函数添加时不加命名空间
            sourceBuilder.Append(text);



            SourceText sourceText = SourceText.From(sourceBuilder.ToString(), Encoding.UTF8);
            return sourceText;
        }

//        public static string Generate()
//        {
//            const string text = @"using Miao.UI;
//using UnityEngine;

//namespace Assets
//{
//    public partial class FastTest : UIPanel, IUIExtend//这个再试试
//    {
//       public int temp;
//       public void OutPut()
//        {
//             Debug.Log(""Data"");
//        }
//    }

//}
//";


//            var sourceBuilder = new StringBuilder();
//            //这个函数添加时不加命名空间
//            sourceBuilder.Append(text);
//            return sourceBuilder.ToString();


//        }
   }
}
